package com.kefu.call.vo;

import javax.validation.constraints.Size;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractInsertVo;
import com.kefu.call.model.CallAvoidDial;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author francis
 * @date 2022/06/19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "免打号码")
public class CallAvoidDialInsertVo extends AbstractInsertVo<CallAvoidDial> {

    @Size(max = 32)
    @ApiModelProperty(value = "电话")
    private String telephone;
    @Size(max = 32)
    @ApiModelProperty(value = "姓名")
    private String name;
    @Size(max = 128)
    @ApiModelProperty(value = "备注")
    private String desb;
    @Size(max = 32)

    @Override
    public CallAvoidDial convert() {
        CallAvoidDial info = new CallAvoidDial();
	    info.setTelephone(telephone);
	    info.setName(name);
	    info.setDesb(desb);
        KefuContext context = KefuContext.getKefuContext();
        info.setCreateId(context.getUserId());
	    info.setCreateTime(context.getNow());
	    info.setTenantId(context.getTenantId());
	    return info;
	}
}